{{csrf_field()}}
<style>
    .img_box {
        position: relative;
        width: 100px;
        margin-right: 10px;
        float:left;
    }

    .img_del {
        position: absolute;
        right: 0;
        top: 0;
        display: flex;
        width: 18px;
        height: 18px;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        border-radius: 50%;
        background: #333333;
        opacity: .5;
        color: #ffffff;
    }

    .img_del:hover {
        opacity: 1;
    }
    .uploadedimg{
        position: absolute;
        right:0;
        bottom:0;
        width: 100%;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        background: #333333;
        opacity: .5;
        color: #ffffff;
    }

    .red{
        color: white;
        font-weight: 900;
    }

    .progress{
        margin-top:2px;
        width: 200px;
        height: 14px;
        margin-bottom: 10px;
        overflow: hidden;
        background-color: #f5f5f5;
        border-radius: 4px;
        -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
        box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
    }
    .progress-bar{
        background-color: rgb(92, 184, 92);
        background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.14902) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.14902) 50%, rgba(255, 255, 255, 0.14902) 75%, transparent 75%, transparent);
        background-size: 40px 40px;
        box-shadow: rgba(0, 0, 0, 0.14902) 0px -1px 0px 0px inset;
        box-sizing: border-box;
        color: rgb(255, 255, 255);
        display: block;
        float: left;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        transition-delay: 0s;
        transition-duration: 0.6s;
        transition-property: width;
        transition-timing-function: ease;
        width: 266.188px;
    }
</style>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>基础信息</legend>
</fieldset>

<div class="layui-form-item" style="z-index:9999">
    <div class="layui-inline">
        <label class="layui-form-label">所属区域</label>

        <div class="layui-input-inline">
            <select name="province_code" lay-filter="province" lay-verify="province"  lay-search="">
                <option value="">请选择省</option>
            </select>
            <input type="hidden" name="province_name" id="province_name"  value="{{$renter->province_name??old('province_name')}}">
        </div>
        <div class="layui-input-inline">
            <select name="city_code" id="city_code" lay-filter="city" lay-search="" lay-verify="city">
                <option value="">请选择市</option>
            </select>
            <input type="hidden" name="city">
            <input type="hidden" name="city_name" id="city_name" value="{{$renter->city_name??old('city_name')}}">
        </div>
        <div class="layui-input-inline">
            <select name="region_code" id="region_code" lay-filter="region" lay-search="" lay-verify="region">
                <option value="">请选择县/区</option>
            </select>
            <input type="hidden" name="region_name" id="region_name" value="{{$renter->region_name??old('region_name')}}">
        </div>
    </div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">场租方名称 </label>
    <div class="layui-input-inline">
        <input type="text" name="name" id="name"  value="{{$renter->name??old('name')}}" placeholder="请输入场租方名称" class="layui-input" lay-verify="name"  >
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">联系人</label>
        <div class="layui-input-inline">
            <input type="text" name="linkman" id="linkman" value="{{$renter->linkman??old('linkman')}}" class="layui-input" placeholder="场租方联系人"  lay-verify="linkman"/>
        </div>
    </div>

</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">联系人电话</label>
        <div class="layui-input-inline">
            <input type="text" name="telephone" id="telephone" value="{{$renter->telephone??old('telephone')}}" class="layui-input"  lay-verify="telephone" placeholder="联系人电话"/>
        </div>
    </div>
</div>


<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">合作时间</label>
        <div class="layui-inline" id="contractBetween">
            <div class="layui-input-inline">
                <input type="text"  id="starttime" value="{{$contract[0]->starttime??old('starttime')}}" name="starttime" class="layui-input" placeholder="开始日期" lay-verify="starttime" >
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline">
                <input type="text"  id="endtime" value="{{$contract[0]->endtime??old('endtime')}}" name="endtime" class="layui-input" placeholder="结束日期" lay-verify="endtime" >
            </div>
        </div>
    </div>
</div>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>合作信息</legend>
    <input type="hidden" name="contract_id" id="contract_id" value="{{$contract[0]->id??old('contract_id')}}">
</fieldset>
<div class="layui-form-item">
    <label for="" class="layui-form-label">场地费</label>
    <div class="layui-input-block">
        <input type="radio" name="rente_type"  value="0" title="免场租" lay-skin="primary" lay-verify="rente_type" @if(isset($contract[0]->rente_type)&& $contract[0]->rente_type == 0) checked @endif >
        <input type="radio" name="rente_type"  value="1" title="固定费用" lay-skin="primary" lay-verify="rente_type" @if(isset($contract[0]->rente_type)&& $contract[0]->rente_type == 1) checked @endif @if (!isset($contract)) checked @endif>
        <div class="layui-inline">
        <input type="text"  id="rente_price" value="{{$contract[0]->rente_price??old('rente_price')}} @if (!isset($contract)) 0 @endif" name="rente_price" class="layui-input" placeholder="场地费" lay-verify="rente_price" >
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">物业费</label>
    <div class="layui-input-block">
        <input type="radio" name="property_type"  value="0" title="免物业" lay-skin="primary" lay-verify="property_type" @if(isset($contract[0]->property_type)&& $contract[0]->property_type == 0) checked @endif @if (!isset($contract)) checked @endif>
        <input type="radio" name="property_type"  value="1" title="固定费用" lay-skin="primary" lay-verify="property_type" @if(isset($contract[0]->property_type)&& $contract[0]->property_type == 1) checked @endif>
        <div class="layui-inline">
            <input type="text"  id="rente_price" value="{{$contract[0]->property_price??old('property_price')}} @if (!isset($contract)) 0 @endif" name="property_price" class="layui-input" placeholder="物业费" lay-verify="property_price" >
        </div>
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">水电费</label>
    <div class="layui-input-block">
        <input type="radio" name="water_electricity_type"  value="0" title="免水电" lay-skin="primary" lay-verify="water_electricity_type" @if(isset($contract[0]->water_electricity_type)&& $contract[0]->water_electricity_type == 0) checked @endif @if (!isset($contract)) checked @endif>
        <input type="radio" name="water_electricity_type"  value="1" title="月度填报" lay-skin="primary" lay-verify="water_electricity_type" @if(isset($contract[0]->water_electricity_type)&& $contract[0]->water_electricity_type == 1) checked @endif>
    </div>
</div>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>运营模式</legend>
</fieldset>
<div class="layui-form-item">
    <label for="" class="layui-form-label">分润</label>
    <div class="layui-input-block">
        <input type="radio" name="operation_type"  value="0" title="自运营" lay-skin="primary" lay-verify="operation_type" @if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 0) checked @endif @if (!isset($contract)) checked @endif>
    </div>

</div>
<!--分润A方案-->
<div class="layui-form-item">
    <label for="" class="layui-form-label"></label>
    <div class="layui-input-block">
        <input type="radio" name="operation_type"  value="1" title="合作运营A" lay-skin="primary" lay-verify="operation_type" @if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 1) checked @endif>
        <div class="layui-inline">
            <label class="layui-form-label">分润比例</label>
            <div class="layui-input-inline">
                <input type="text"  id="operation_price_A1" value="@if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 1) {{$contract[0]->operation_price1??old('operation_price1')}} @endif" name="operation_price_A1" class="layui-input" placeholder="我方" lay-verify="operation_price1" >
            </div>
        </div>
        <div class="layui-inline">
            <input type="text"  id="operation_price_A2" value="@if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 1) {{ $contract[0]->operation_price2??old('operation_price2') }} @endif" name="operation_price_A2" class="layui-input" placeholder="场地方" lay-verify="operation_price2" >
        </div>
    </div>

</div>
<!--分润B方案-->
<div class="layui-form-item">
    <label for="" class="layui-form-label"></label>
    <div class="layui-input-block">
        <input type="radio" name="operation_type"  value="2" title="合作运营B" lay-skin="primary" lay-verify="operation_type" @if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 2) checked @endif>
        <div class="layui-inline">
            <label class="layui-form-label">单笔分润</label>
            <div class="layui-input-inline">
                <input type="text"  id="operation_price_B1" value="@if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 2) {{$contract[0]->operation_price1??old('operation_price1')}} @endif" name="operation_price_B1" class="layui-input" placeholder="xx元/单" lay-verify="operation_price1" >
            </div>
        </div>
        <div class="layui-inline">
            <input type="text"  id="operation_price_B2" value="@if(isset($contract[0]->operation_type)&& $contract[0]->operation_type == 2) {{ $contract[0]->operation_price2??old('operation_price2') }} @endif" name="operation_price_B2" class="layui-input" placeholder="保底月收元/月" lay-verify="operation_price2" >
        </div>
    </div>

</div>

<div class="layui-form-item">
    <div class="layui-inline" style="width:100%;">
        <label class="layui-form-label">场租方合同</label>
        <div class="layui-input-inline "  style="width:90%;">
            <div class="imgboxhtml" style="width: auto;">
            @php
                $contracturl = "";
                if (!empty($contract[0]->contracturl))
                {
                    $arra = explode(",", $contract[0]->contracturl);
                    foreach ($arra as $k => $v){
                        //echo '<a class="layui-btn layui-btn-sm" href="'.$v.'" target="_blank">预览</a>&nbsp;';
                        echo '<div class="img_box">';
                        echo '<img layer-pid="" class="img_item" id="contracturl'.$k.'" title="点击预览图片" layer-src="'.$v.'" src="'.$v.'" width="100px">';
                        echo '<span class="img_del" title="点击删除图片" data-id="'.$k.'" data-type="'.$k.'">X</span>';
                        echo '</div>';
                    }

                    $contracturl = $contract[0]->contracturl;
                }
            @endphp
            </div>
            @php
                echo '<input type="hidden" name="contracturl" id="contracturl" lay-verify="contracturl" value="'.$contracturl.'" />';
                echo '<a class="layui-btn layui-btn-sm "  id="uploadcontracturlbnt" >上传合同</a>';

            @endphp
        </div>
    </div>

</div>

<div class="layui-form-item layui-layout-admin">
    <div class="layui-input-block">
        <input type="hidden" name="status" id="status" value="0" />
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
            <a class="layui-btn layui-btn-normal" onclick="javascript:window.history.back(-1)" >返回</a>
    </div>
</div>
<script>
var imglen = {{$imglen??0}};
</script>